<script setup>
import { manageGetServe } from '@/api/person'
import { ref } from 'vue'

const dialogVisible = ref(false)
const loading = ref(false)
const adminList = ref([])
const openShowAdmin = async () => {
  dialogVisible.value = true
  loading.value = true
  const res = await manageGetServe()
  adminList.value = res
  ElMessage.success({ message: '获取成功', offset: 70 })
  loading.value = false
}
defineExpose({
  openShowAdmin
})
</script>

<template>
  <el-dialog v-model="dialogVisible" title="管理员列表" width="40%">
    <div>
      <el-table :data="adminList" v-loading="loading">
        <el-table-column align="center" label="序号" type="index" width="123"> </el-table-column>
        <el-table-column align="center" label="账号" prop="id"> </el-table-column>
        <el-table-column align="center" label="姓名" prop="name"> </el-table-column>
      </el-table>
    </div>
    <template #footer>
      <div class="dialog-footer">
        <el-button @click="dialogVisible = false">退出</el-button>
      </div>
    </template>
  </el-dialog>
</template>

<style lang="" scoped></style>
